<?php
/**
 * Created by PhpStorm.
 * User: cat
 * Date: 2019/3/17
 * Time: 11:13
 */
const  ErrorLogPath = ".\ErrorLog.txt";
include_once 'C:\wamp64\www\Php studio\Utils\IoUtils\FileHelper.php';
include_once 'C:\wamp64\www\Php studio\Utils\TimeUtils\TimeUtils.php';
/***
 * @param $LogInfo   日志信息
 *
 */
function PrintLog($LogInfo)
{  $LogText="";
    if (is_array($LogInfo))
    {
        $LogText="\r\n" . GetLocalTime() . ":" . implode("\r\n", $LogInfo);
    }
    else  {
	   $LogText="\r\n" . GetLocalTime() . ":" . $LogInfo;
    }
    echo  $LogText;
    AppEndText(ErrorLogPath, $LogText);
}

/***
 *
 * 获取当前运行时的最后一个错误警告
 */

function GetError()
{ $e = error_get_last();
    if (is_array($e)) {

	   PrintLog("\r\ntype:" . $e['type'] . "\r\nmessage:" . $e['message'] . "\r\nfile:" . $e['file'] . "\r\nline:" . $e['line']);
    }
}

?>